//
//  UIBarButtonItem+button.m
//  HuiZhiMin
//
//  Created by 郑信鸿 on 16/9/17.
//  Copyright © 2016年 胡钢祥. All rights reserved.
//

#import "UIBarButtonItem+button.h"

@implementation UIBarButtonItem (button)

+ (instancetype)initWithFrame:(CGRect)frame image:(UIImage *)image target:(id)target action:(SEL)action{
    
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.frame = frame;
    [button setImage:image forState:UIControlStateNormal];
    [button addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
    UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithCustomView:button];
    return item;
}

@end
